//
// Created by dave on 18-7-28.
//

#pragma once
#include <memory>
#include <vector>
#include <boost/asio/streambuf.hpp>
#include <boost/system/error_code.hpp>

class channel;

class channel_handler : public std::enable_shared_from_this<channel_handler> {
public:
    virtual ~channel_handler() = default;

    virtual void on_open(std::shared_ptr<channel> ch) { };

    virtual void on_read(std::shared_ptr<channel> ch, const unsigned char* buf, int size) { }

    virtual void on_error(std::shared_ptr<channel> ch, boost::system::error_code ec) { }

    virtual void on_close(std::shared_ptr<channel> ch, boost::system::error_code ec) { }

private:
};
